package com.ifast.asset.util;

import java.util.UUID;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadPoolUtil {

    public static final ExecutorService cachedThreadPool = Executors.newCachedThreadPool(r -> {

        Thread thread = new Thread(r);
        thread.setName("worker-thread-" + UUID.randomUUID().toString());
        return thread;
    });
    private  ThreadPoolUtil(){}

    public static ExecutorService getCachedThreadPool(){

        return cachedThreadPool;
    }
}
